from typing import *


class Solution:
    def findKOr(self, nums: List[int], k: int) -> int:
        n = 31
        cnt = Counter()
        ans = 0
        for num in nums:
            for i in range(n):
                if (num >> i) & 1 == 1:
                    cnt[i] += 1
                    if cnt[i] == k:
                        ans |= 1 << i
        return ans
